package com.woniuxy.stage3demo.service.kang.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniuxy.stage3demo.bean.kang.CouUserBean;
import com.woniuxy.stage3demo.mapper.kang.CouUserMapper;
import com.woniuxy.stage3demo.pageHelper.PageRequest;
import com.woniuxy.stage3demo.service.kang.ICouUserService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;

@Service
@Transactional(readOnly = true)
public class CouUserServiceImpl implements ICouUserService {

    @Resource
    private CouUserMapper couUserMapper;

    @Override
    public PageInfo<CouUserBean> findLimit(PageRequest pageRequest, CouUserBean couUserBean) {
        return PageHelper.startPage(pageRequest.getPageNum(),pageRequest.getLimit()).doSelectPageInfo(()->couUserMapper.findLimit(pageRequest,couUserBean));
    }
}
